package cn.tedu.web;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.Arrays;

@WebServlet( "/paramServlet")
public class paramServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        String uservalue = request.getParameter("username");
        System.out.println("请求的用户名:"+uservalue);
        String pswValue = request.getParameter("psw");
        System.out.println("请求的密码"+pswValue);
        String[] hobbies = request.getParameterValues("hobby");
        System.out.println("请求的爱好:"+ Arrays.toString(hobbies));
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
